/*
 * @Author: tanjunyi@doctorwork.com
 * @Date: 2020-06-19 00:00:11
 * @LastEditors: tanjunyi@doctorwork.com
 * @LastEditTime: 2020-06-21 13:27:50
 * @Description:
 */
import { parseHTML } from './parser';
import { generate } from './generator';
/**
 * 模板解析成虚拟节点
 * @param {*} template 
 */
export const compildToFunction = (template) => {
	let ast = parseHTML(template);
	let code = generate(ast);
	code = `with(this){return ${code}}`;
	let render = new Function(code);
	return render;
}